package com.liangzhong.model.goods.vo
{
	import com.global.GlobalDef;
	import com.liangzhong.model.AppData;
	import com.liangzhong.model.buffer.vo.BufferVo;
	import com.liangzhong.model.type.GoodsType;
	import com.liangzhong.model.type.OtherGoodType;

	/**
	 * 药剂 
	 * @author lake
	 * 
	 */	
	public class DrugVo extends GoodsVo
	{
		/**
		 * 药剂id
		 */		
		public var drugid 			:int;
		/**
		 * 药剂名字
		 */		
		public var drugname 		:String;
		/**
		 * 类型：
			1.	进攻
			2.	防守
			3.	抢断
			4.	力量
			5.	速度
			6.	控球
		 */		
		//public var ntype 			:int;
		
		public function DrugVo()
		{
			super();
		}
		/**
		 *解析数据 
		 * @param data
		 * 
		 */		
		override public function parse(data :Object):void
		{
			var xmlList:XMLList = data.children();
			for each(var xml:XML in xmlList)
			{
				if(this.hasOwnProperty(xml.localName()))
				{
					this[xml.localName()] = xml.toString();
				}
			}
			name 	= drugname;
			url  	= GlobalDef.Web_Res_Url + "prop/" + header;
			type 	= GoodsType.DRUG;
			ntype	= OtherGoodType.DRUG;
			pid 	= drugid;
			gid		= drugid;
		}
		/**
		 *获取tips 显示信息 
		 * @return 
		 * 
		 */		
		override public function get tipsInfo():String
		{
			var info :String = "<p align='left'><font>" + name + "</font>\n";
			info += "</p>";
			var bufferVo :BufferVo = AppData.getInstance().bufferManager.getBufferById(buffid);
			if(bufferVo)
			{
				info += bufferVo.bufferTips;
			}
			descplay = descplay.replace("双击使用","");
			info += "<p align='left'>" + descplay + "</p>";
			info +="<p align='left'><font color='#33ccff'>双击使用</font>";
			return info;
		}
	}
}